$(function () {
    var userId = config.getUserId();

    $.get(config.baseUrl + "/account/quaryAccount.json",{userId: userId}, function(result){
        if (result.status == 200) {
            var html = template("account-type-temp", result);
            $("#account-type").html(html);
        }
    });
    template.defaults.imports.accountTypeName = function(value){
        return config.accountType(value);
    };

})

/*
   * 转回账户
   * */
function profitsToNormal(){
    var param = {
        userId:config.getUserId(),
        profitsAccountId:$("#profitsAccountId").val(),
        amount:$("#amount").val()
    }
    $.ajax({
        type:"post",
        url:config.baseUrl+"account/profitsToNormal.json",
        data:param,
        dataType:"json",
        success:function (data) {

        }
    })
    return false;
}